Reversed Method

Wintellect PowerCollections

Collapse imageExpand ImageCollapseAll imageExpandAll imageDropDown imageDropDownHover imageCopy imageCopyHover image
[This topic is pre-release documentation and is subject to change in future releases. Blank topics are included as placeholders.]

Returns a View collection that can be used for enumerating the keys and values in the collection in reversed order.

Namespace: Wintellect.PowerCollections
Assembly:  PowerCollections (in PowerCollections.dll)

Syntax

C#
public OrderedDictionary<TKey, TValue>.OrderedDictionary<(Of <TKey, TValue>)>..::View Reversed()
Visual Basic (Declaration)
Public Function Reversed As OrderedDictionary<(Of <TKey, TValue>)>..::View
Visual C++
public:
OrderedDictionary<(Of <TKey, TValue>)>..::View^ Reversed ()

Return Value

An OrderedDictionary.View of key-value pairs in reverse order.

Remarks

Typically, this method is used in conjunction with a foreach statement. For example:

 Copy imageCopy Code
             foreach(KeyValuePair<TKey, TValue> pair in dictionary.Reversed()) {
                // process pair
             }
            

If an entry is added to or deleted from the dictionary while the View is being enumerated, then the enumeration will end with an InvalidOperationException.

Calling Reverse does not copy the data in the dictionary, and the operation takes constant time.

See Also